var t = require("../config/config.js"), e = function(e, n, r) {
    return new Promise(function(o, u) {
        wx.request({
            url: t.serverAddress + e,
            method: n.toUpperCase(),
            dataType: "json",
            data: r,
            header: {
                "content-type": "application/json"
            },
            success: function(t) {
                o(t.data);
            },
            fail: function(t) {
                u(t);
            }
        });
    });
}, n = {
    getChatList: function(t) {
        return e("/chat/query", "POST", t);
    },
    getChatRandom: function(t) {
        return e("/chat/queryRandom", "POST", t);
    },
    getAdjacentChatId: function(t) {
        return e("/chat/getAdjacentChatId", "POST", t);
    },
    getWordsList: function(t) {
        return e("/words/query", "POST", t);
    },
    getCollectionList: function(t) {
        return e("/collection/query", "POST", t);
    },
    wxUserLogin: function(t) {
        return e("/wxUser/login", "POST", t);
    },
    addContribute: function(t) {
        return e("/contribute/addContribute", "POST", t);
    },
    getContributeByOpenid: function(t) {
        return e("/contribute/getContributeByOpenid", "POST", t);
    },
    getWxUserInfo: function(t) {
        return e("/wxUser/query", "POST", t);
    }
};

module.exports = n;